home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / mailconf / basic.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-18  |  3.7 KB  |  121 lines

  1. #include "../dialog/dialog.h"
  2. #include "internal.h"
  3. #include "../userconf/userconf.h"
  4. #include "mailconf.m"
  5.  
  6. static MAILCONF_HELP_FILE help_basic ("basic");
  7. extern CONFIG_FILE f_sendmail;
  8.  
  9. /*
  10.     Define the help list for the available mailer
  11. */
  12. void basic_setmailer (FIELD_COMBO *comb)
  13. {
  14.     comb->addopt ("esmtp",MSG_U(F_ESMTP,"Enhanced smtp"));
  15.     comb->addopt ("smtp",MSG_U(F_SMTP,"Normal smtp"));
  16.     comb->addopt ("uucp-dom",MSG_U(F_MODERNUUCP,"Recommended modern UUCP"));
  17.     comb->addopt ("uucp",MSG_U(F_OLDUUCP,"Old uucp"));
  18. }
  19.  
  20.  
  21. PUBLIC int MAILCONF::basicedit()
  22. {
  23.     DIALOG dia;
  24.     dia.newf_title ("",MSG_U(T_WHENREC,"When receiving"));
  25.     {
  26.         const char *title = MSG_U(F_YOURSYS,"Alias for your system");
  27.         for (int i=0; i<NB_ALIAS; i++){
  28.             dia.newf_str (title,*alias.getitem(i));
  29.             title = "";
  30.         }
  31.     }
  32.     dia.newf_title ("",MSG_U(F_WHENSEND,"When sending"));
  33.     dia.newf_str (MSG_U(F_PRESENT,"Present your system as"),mailas);
  34.     dia.newf_str (MSG_U(F_MAILHOST,"mail host"),mailhost);
  35.     dia.newf_str (MSG_U(F_SMARTHOST,"Smart host"),smarthost);
  36.     FIELD_COMBO *comb = dia.newf_combo (MSG_U(F_SMARTMAIL
  37.         ,"Smart host mailer"),smartmailer);
  38.     basic_setmailer (comb);
  39.     dia.newf_title ("",MSG_U(T_FEATURES,"Features"));
  40.     dia.newf_chk ("",features.uucpnobatch,MSG_U(F_NOBATCH
  41.         ,"no batching for uucp mail"));
  42.     dia.newf_num (MSG_U(F_MAXSIZE,"Max size of uucp messages")
  43.         ,features.uucpmax);
  44.     dia.newf_str (MSG_U(F_DELIVER,"Deliver locally to users")
  45.         ,users.deliverlocal);
  46.     dia.newf_str (MSG_U(F_NOMASQ,"No masquerade from users")
  47.         ,users.dontmasque);
  48.     comb = dia.newf_combo (MSG_U(F_SPECIAL
  49.          ,"Special routing database format")
  50.         ,features.dbformat);
  51.     comb->addopt ("btree");
  52.     comb->addopt ("hash");
  53.     comb->addopt ("dbm");
  54.     comb->addopt ("NIS");
  55.  
  56.     comb = dia.newf_combo (MSG_U(F_LOCALMAILER,"Local delivery agent")
  57.         ,deliver);
  58.     comb->addopt ("deliver","/usr/bin/deliver");
  59.     comb->addopt ("mail.local","/bin/mail.local");
  60.     comb->addopt ("procmail","/usr/bin/procmail");
  61.  
  62.     dia.newf_title ("",MSG_U(T_DNSFEATURES,"DNS features"));
  63.     dia.newf_chk ("",features.dnsneeded,MSG_U(F_WAITDNS,"wait for DNS"));
  64.     dia.newf_chk ("",features.nodns,MSG_U(F_NODNS,"don't use DNS"));
  65.     #ifdef DNS_LIMIT
  66.         /* #Specification: mailconf / limiting DNS scope
  67.             An attempt was made to somewhat limit
  68.             the DNS usage of sendmail. One way
  69.             is to desactivate DNS canonification in
  70.             ruleset 96. mailconf allows this.
  71.  
  72.             This is fine for small site with a single
  73.             mailhost for example.
  74.  
  75.             Larger site may have several mailhost
  76.             with several subdomain and yet no full
  77.             connectivity to the internet, and to make
  78.             things worst, have sometime some connectivity
  79.             on the internet. It means that the DNS knows
  80.             how to resolv any name but will generally
  81.             fail, unless someone establish the internet
  82.             connection.
  83.  
  84.             So on one hand, we need DNS flexibility and
  85.             MXs, and on the other hand we must avoid it
  86.             to make sure sendmail won't timeout needlessly.
  87.             In fact, in this setup, email is either local
  88.             or through a forwarder which knows better anyway.
  89.  
  90.             This half DNS solution is still a problem.
  91.             One solution would be to restart the DNS
  92.             with or without a root.cache file when
  93.             connected or not connected to the internet.
  94.  
  95.             If this problem rings bell to you, I would
  96.             be happy to talk about it. I am pretty sure
  97.             something generally useful would come out of  it.
  98.         */
  99.         dia.newf_title ("",MSG_U(F_LIMITDNS,"Limit DNS for those domains"));
  100.         for (int d=0; d<MAXDNSFOR; d++){
  101.             dia.newf_str ("",dnsfor[d]);
  102.         }
  103.     #endif
  104.  
  105.  
  106.     int ret = 0;
  107.     if (dia.edit(MSG_U(T_BASIC,"Basic Sendmail configuration")
  108.         ,""
  109.         ,help_basic.getpath()
  110.         ,0) == MENU_ACCEPT){
  111.         if (!perm_rootaccess(MSG_U(P_CONFMAIL,"configure sendmail"))){
  112.             dia.restore();
  113.         }else{
  114.             write ();
  115.             ret = 1;
  116.         }
  117.     }
  118.     return ret;
  119. }
  120.  
  121.